<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	template="/WEB-INF/template/layout.xhtml">

	<ui:define name="title">
		 #{msg['menu.register.text']}
	</ui:define>

	<ui:define name="content">

		<h2>#{msg['menu.register.text']}</h2>
		<h:outputText value="#{msg['register.paragraph.text']}" escape="false"/>

		<ui:decorate template="/WEB-INF/component/form.xhtml">
		
			<ui:param name="formId" value="registerForm" />
			<ui:param name="formLegend" value="#{msg['register.legend']}" />

			<ui:define name="formInputs">

				<ui:decorate template="/WEB-INF/component/inputText.xhtml">
					<ui:param name="inputId" value="registerUsername" />
					<ui:param name="inputValue" value="#{registerUserBean.username}" />
					<ui:param name="labelValue" value="#{msg['user.username.text']}" />
					<ui:param name="render" value="registerUsername" />
					<ui:param name="inputStyleClass" value="input" />

					<ui:define name="inputChildren">
						<f:validator for="registerUsername"
							validatorId="usernameValidator" />
					</ui:define>

				</ui:decorate>

				<ui:decorate template="/WEB-INF/component/inputText.xhtml">
					<ui:param name="inputId" value="registerName" />
					<ui:param name="inputValue" value="#{registerUserBean.name}" />
					<ui:param name="labelValue" value="#{msg['user.name.text']}" />
					<ui:param name="render" value="registerName" />
					<ui:param name="inputStyleClass" value="input" />
				</ui:decorate>

				<ui:decorate template="/WEB-INF/component/inputText.xhtml">
					<ui:param name="inputId" value="registerFirstSurname" />
					<ui:param name="inputValue"
						value="#{registerUserBean.firstSurname}" />
					<ui:param name="labelValue"
						value="#{msg['user.firstSurname.text']}" />
					<ui:param name="render" value="registerFirstSurname" />
					<ui:param name="inputStyleClass" value="input" />
				</ui:decorate>

				<ui:decorate template="/WEB-INF/component/inputText.xhtml">
					<ui:param name="inputId" value="registerSecondSurname" />
					<ui:param name="inputValue"
						value="#{registerUserBean.secondSurname}" />
					<ui:param name="labelValue"
						value="#{msg['user.secondSurname.text']}" />
					<ui:param name="render" value="registerSecondSurname" />
					<ui:param name="inputStyleClass" value="input" />
				</ui:decorate>

				<ui:decorate template="/WEB-INF/component/inputText.xhtml">
					<ui:param name="inputId" value="registerEmail" />
					<ui:param name="inputValue" value="#{registerUserBean.email}" />
					<ui:param name="labelValue" value="#{msg['user.email.text']}" />
					<ui:param name="render" value="registerEmail" />
					<ui:param name="inputStyleClass" value="inputLargo" />
				</ui:decorate>

			</ui:define>

			<ui:define name="formButtons">
				<h:commandButton id="registerUserButton"
					action="#{registerUserBean.registerUser}"
					value="#{msg['register.button.text']}"/>			
					
			</ui:define>

		</ui:decorate>

	</ui:define>

</ui:composition>
